package app.Insam.VNC;

import android.app.Application;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class InsamApp extends Application {
	public static final String TAG = "InsamApp";
	
	public static final int MILISEC_PER_METER = 100;
	public static final int TIME_RESCAN_MINIMUM = 1000*60*5; 		// 5mins
	public static final int TIME_RESCAN_IN_OFFICE = 1000*60*30;		// 30mins

	public static boolean InOffice;
	public static String OfficeSSID;
	public static InsamLocationInfo OfficeLocation;

	@Override
	public void onCreate() {
		super.onCreate();
//		Log.d(TAG, "App:onCreate");
		InOffice = false;	
		SharedPreferences mPref = PreferenceManager.getDefaultSharedPreferences(this);  
		String loc = mPref.getString(InsamPreferencesKey.Office_Location.toString(), null);
		if(loc==null || loc.equals("")) {
			OfficeLocation = null;
		} else {
			OfficeLocation = new InsamLocationInfo(loc);
		}
		
		OfficeSSID = mPref.getString(InsamPreferencesKey.Office_SSID.toString(), null);
		
		/* below is for debug */
		InsamDebugger.init(getApplicationContext(), mPref.getBoolean("DBG", false));
	}
}
